package com.itheima.logAdvice;

import org.aspectj.lang.ProceedingJoinPoint;

public class LogAdvice {
    public void before(){
        System.out.println("qian ");
    }

    public void after(){
        System.out.println("hou ");
    }
    public void afterreturning(){
        System.out.println("run ");
    }
    public void afterthowing(){
        System.out.println("thowing ");
    }

    public Object around(ProceedingJoinPoint pjp){
        System.out.println("111");
        try {
            Object proceed = pjp.proceed();
            System.out.println(proceed);
            System.out.println("2222");
        } catch (Throwable throwable) {
            System.out.println("3333");
            throwable.printStackTrace();
        }
        System.out.println("4444");
        return null;
    }
}
